home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume89 / printers / printfx.1
Internet Message Format  |  1989-05-18  |  45KB

  1. Path: xanth!ames!apple!sun!swap!page
  2. From: page%swap@Sun.COM (Bob Page)
  3. Newsgroups: comp.sources.amiga
  4. Subject: v89i148:  printfx - print on your epson fx
  5. Message-ID: <105684@sun.Eng.Sun.COM>
  6. Date: 18 May 89 18:56:43 GMT
  7. Sender: news@sun.Eng.Sun.COM
  8. Lines: 1498
  9. Approved: page@sun.com
  10.  
  11. Submitted-by: neabbs!amichel@nluug.nl
  12. Posting-number: Volume 89, Issue 148
  13. Archive-name: printers/printfx.1
  14.  
  15. [uuencoded executable included.  I had to mung the 'execute.me' file
  16. to get the lines less than 80 characters long.  You'll have to re-join
  17. them.  ("blinkers on"?)  ..bob]
  18.  
  19. # This is a shell archive.
  20. # Remove anything above and including the cut line.
  21. # Then run the rest of the file through 'sh'.
  22. # Unpacked files will be owned by you and have default permissions.
  23. #----cut here-----cut here-----cut here-----cut here----#
  24. #!/bin/sh
  25. # shar: SHell ARchive
  26. # Run the following text through 'sh' to create:
  27. #    Notice
  28. #    _main.a
  29. #    an
  30. #    cst.a
  31. #    execute.me
  32. #    explain.a
  33. #    offswitch.a
  34. #    printfx.c
  35. #    printfx.doc
  36. #    printfx.n
  37. #    printfx.uu
  38. #    stoi.c
  39. # This is archive 1 of a 1-part kit.
  40. # This archive created: Thu May 18 11:43:17 1989
  41. echo "extracting Notice"
  42. sed 's/^X//' << \SHAR_EOF > Notice
  43. XOn your own risk you may do what you like with this code.  It's PD.  D.Reisig.
  44. SHAR_EOF
  45. echo "extracting _main.a"
  46. sed 's/^X//' << \SHAR_EOF > _main.a
  47. X
  48. X
  49. XEOL    equ    $0a        CLI command activator
  50. X
  51. X    xdef    __main
  52. X
  53. X    csect    text,0,0,1,2    any xref's after this are 16-bit reloc
  54. X
  55. X    xref    _main        Name of C program to start with.
  56. X
  57. X__main:    movem.l    d2/d3/a2,-(a7)
  58. X
  59. X*** insert terminators, get pointers, find argc
  60. X    move.l    a7,a2        keep stackpointer
  61. X    move.l    16(a7),a0    get begin
  62. X    lea.l    0(a7),a1    remember first argv for reverse action
  63. X    moveq.l    #0,d3        argc (program name)
  64. X
  65. XSrcNSp    move.b    (a0),d0        search *argv
  66. X    cmp.b    #' ',d0        spaces are delimiters
  67. X    bhi.s    Found        any printable but SP causes an *argv
  68. X    bcs.s    FinalT        any control causes a leave loop
  69. XKillSp    clr.b    (a0)+        no spaces allowed
  70. X    bra.s    SrcNSp
  71. XFound    cmp.b    #'"',d0        entry embedded spaces?
  72. X    beq.s    SplFnd        yes, special search action
  73. X    move.l    a0,-(a7)    no, normal, push a *argv
  74. X    addq.l    #1,d3        ++argc
  75. XSrcSp    cmp.b    #' ',(a0)    now search for end
  76. X    beq.s    KillSp        end found, search next *argv
  77. X    bcs.s    FinalT        very end found; leave
  78. X    addq.l    #1,a0        still inside argument,
  79. X    bra.s    SrcSp        so keep searching for delimiter
  80. XSplFnd    addq.l    #1,a0        skip special entry code char
  81. X    move.l    a0,-(a7)    push a *argv
  82. X    addq.l    #1,d3        ++argc
  83. XSrcSpl    move.b    (a0),d0        only '"' and '\0' are delimiters (EOL?)
  84. X    beq.s    FinalT        very end found; leave
  85. X    cmp.b    #'"',d0        special delimiter?
  86. X    beq.s    KillSp        yes, act like space found
  87. X    cmp.b    #EOL,d0        @ we look for EOL too
  88. X    beq.s    FinalT        @ and leave on meeting it
  89. X    addq.l    #1,a0        no, still inside argument,
  90. X    bra.s    SrcSpl        so keep searching for delimiter
  91. XFinalT    clr.b    (a0)        now, here is my story:
  92. X
  93. X* If the command line does not contain any embedded space arguments,
  94. X* FinalTerm deletes the closing control, normally a LF. However, you are
  95. X* allowed to embed all controls but '\0' in embedded space arguments. If
  96. X* you do not close this argument with '"', but instead gives an EOL, this
  97. X* EOL takes part of this argument. In this version, we leave the loop on
  98. X* finding it. (@)
  99. X
  100. X*** The argv-array is in reversed order, so do something about it
  101. X    move.l    a7,a0        get begin, end is already in a1
  102. X    move.l    d3,d2        get number of pointers
  103. X    lsr.l    #1,d2        argc/2 we exchange two at a time
  104. X    bra.s    XPtrs1
  105. XXPtrs0    move.l    -(a1),d0
  106. X    move.l    (a0),d1
  107. X    move.l    d0,(a0)+
  108. X    move.l    d1,(a1)
  109. XXPtrs1    dbra    d2,XPtrs0        
  110. X
  111. X*** For some reasons its nice to have a long aligned stackpointer.    
  112. X    move.l    a7,d1        argv
  113. X    move.l    a7,d0        prepare for long line up
  114. X    lsr.l    #2,d0        we look for a carry 
  115. X    bcc.s    LongAl        already long
  116. X    subq.l    #2,a7        make a7 long aligned
  117. XLongAl    move.l    d1,-(a7)    push *argv[]
  118. X    move.l    d3,-(a7)    push argc
  119. X    jsr    _main(pc)    Our main is NOT void!
  120. X    move.l    a2,a7        restore stackpointer
  121. X    movem.l    (a7)+,d2/d3/a2
  122. X    rts
  123. X    
  124. X    end
  125. X
  126. SHAR_EOF
  127. echo "extracting an"
  128. sed 's/^X//' << \SHAR_EOF > an
  129. X.*
  130. X.*    Macro package for NRO in KosmoSoft version
  131. X.*
  132. X.nr h 5      @" header indent
  133. X.nr i 10     @" normal text indent
  134. X.nr s @ni-@nh     @" section heading indent (to the LEFT)
  135. X.*
  136. X.de TH
  137. X.in @nh;.rm 80-@nh;.he |$0($1)|$2|$0($1)|
  138. X.fo |$3|-#-|$4|
  139. X.in @ni;.rm 80-@ni
  140. X.ta +0 +5
  141. X.en
  142. X.*  Paragraph
  143. X.de PP
  144. X.sp 1;.ne 2;.ti +5
  145. X.en
  146. X.*  Bulleted Paragraph. Needs .RE after last para.
  147. X.*  Must be last on line. Relies on first tab stop.
  148. X.de BP
  149. X.br;.in @ni+5;.ti -3;o@t@@
  150. X.en
  151. X.*  Section Heading
  152. X.de SH
  153. X.sp 1;.ne 3;.ti -@@ns;.bo "$0 $1 $2 $3 $4 $6 $6 $7 $8 $9
  154. X.br
  155. X.en
  156. X.*  SubSection
  157. X.de SS
  158. X.br;.ne 2;.ti -@@ns+1/2;$0 $1 $2 $3 $4 $5 $6 $7 $8 $9
  159. X.br
  160. X.en
  161. X.*  Relative indent Start
  162. X.de RS
  163. X.in +0$0
  164. X.en
  165. X.*  Relative indent End
  166. X.de RE
  167. X.in @ni
  168. X.en
  169. X.*  Italics
  170. X.de I
  171. X.it 1
  172. X$0 $1 $2 $3 $4 $5 $6 $7 $8 $9
  173. X.en
  174. X.*  Bold
  175. X.de B
  176. X.bo 1
  177. X$0 $1 $2 $3 $4 $5 $6 $7 $8 $9
  178. X.en
  179. X.*  Underline
  180. X.de U
  181. X.ul 1
  182. X$0 $1 $2 $3 $4 $5 $6 $7 $8 $9
  183. X.en
  184. X.*  UC
  185. X.de UC
  186. X.*  Empty
  187. X.en
  188. X.*  Italics and Roman
  189. X.de IR
  190. X.if !''$0' .it "$0
  191. X.if !''$1' $1
  192. X.if !''$2' .it "$2
  193. X.if !''$3' $3
  194. X.if !''$4' .it "$4
  195. X.if !''$5' $5
  196. X.if !''$6' .it "$6
  197. X.if !''$7' $7
  198. X.if !''$8' .it "$8
  199. X.if !''$9' $9
  200. X.en
  201. X.*  Roman and Italic
  202. X.de RI
  203. X.if !''$0' $0
  204. X.if !''$1' .it "$1
  205. X.if !''$2' $2
  206. X.if !''$3' .it "$3
  207. X.if !''$4' $4
  208. X.if !''$5' .it "$5
  209. X.if !''$6' $6
  210. X.if !''$7' .it "$7
  211. X.if !''$8' $8
  212. X.if !''$9' .it "$9
  213. X.en
  214. X.*  Bold and Roman
  215. X.de BR
  216. X.if !''$0' .bo "$0
  217. X.if !''$1' $1
  218. X.if !''$2' .bo "$2
  219. X.if !''$3' $3
  220. X.if !''$4' .bo "$4
  221. X.if !''$5' $5
  222. X.if !''$6' .bo "$6
  223. X.if !''$7' $7
  224. X.if !''$8' .bo "$8
  225. X.if !''$9' $9
  226. X.en
  227. X.*  Bold and Italic
  228. X.de BI
  229. X.if !''$0' .bo "$0
  230. X.if !''$1' .it "$1
  231. X.if !''$2' .bo "$2
  232. X.if !''$3' .it "$3
  233. X.if !''$4' .bo "$4
  234. X.if !''$5' .it "$5
  235. X.if !''$6' .bo "$6
  236. X.if !''$7' .it "$7
  237. X.if !''$8' .bo "$8
  238. X.if !''$9' .it "$9
  239. X.en
  240. X.*  Italic and Bold
  241. X.de IB
  242. X.if !''$0' .it "$0
  243. X.if !''$1' .bo "$1
  244. X.if !''$2' .it "$2
  245. X.if !''$3' .bo "$3
  246. X.if !''$4' .it "$4
  247. X.if !''$5' .bo "$5
  248. X.if !''$6' .it "$6
  249. X.if !''$7' .bo "$7
  250. X.if !''$8' .it "$8
  251. X.if !''$9' .bo "$9
  252. X.en
  253. X.*  Italic and Roman
  254. X.de IR
  255. X.if !''$0' .it "$0
  256. X.if !''$1' $1
  257. X.if !''$2' .it "$2
  258. X.if !''$3' $3
  259. X.if !''$4' .it "$4
  260. X.if !''$5' $5
  261. X.if !''$6' .it "$6
  262. X.if !''$7' $7
  263. X.if !''$8' .it "$8
  264. X.if !''$9' $9
  265. X.en
  266. X.*  SMall, do nothing
  267. X.de SM
  268. X$0 $1 $2 $3 $4 $5 $6 $7 $8 $9
  269. X.en
  270. SHAR_EOF
  271. echo "extracting cst.a"
  272. sed 's/^X//' << \SHAR_EOF > cst.a
  273. X*
  274. X* C initial startup procedure under AmigaDOS
  275. X* Special stripped version !!
  276. X* 
  277. X
  278. X    INCLUDE    "exec/types.i"
  279. X    INCLUDE    "exec/libraries.i"
  280. X    INCLUDE    "libraries/dos.i"
  281. X    INCLUDE    "libraries/dosextens.i"
  282. X    INCLUDE    "exec/funcdef.i"
  283. X    INCLUDE    "exec/exec_lib.i"
  284. X    INCLUDE    "libraries/dos_lib.i"
  285. X
  286. XAbsExecBase    EQU    4
  287. X
  288. X    xdef    _XCEXIT        exit(code) is standard way to leave C.
  289. X
  290. X    xref    _LinkerDB    linker defined base value
  291. X    xref    __BSSBAS    linker defined base of BSS
  292. X    xref    __BSSLEN    linker defined length of BSS
  293. X
  294. X    csect    text,0,0,1,2    any xref's after this are 16-bit reloc
  295. X
  296. X    xref    __main        Name of C program to start with.
  297. X
  298. Xstart:
  299. X    movem.l d1-d6/a0-a6,-(a7)
  300. XREGSIZE    EQU    (6+7)*4
  301. X    lea    REGSIZE(a7),A5        determine old stack pointer
  302. X    move.l    a0,a2            save command pointer
  303. X    move.l    d0,d2            and command length
  304. X    lea    _LinkerDB,a4        load base register
  305. X
  306. X    lea    __BSSBAS,a0        get base of BSS
  307. X    moveq    #0,d1
  308. X    move.l    #__BSSLEN,d0        get length of BSS in longwords
  309. X    bra.s    clr_lp            and clear for length given
  310. Xclr_bss move.l    d1,(a0)+
  311. Xclr_lp    dbf    d0,clr_bss
  312. X
  313. X    move.l    AbsExecBase.W,a6
  314. X    move.l    a6,_SysBase(A4)
  315. X    move.l    a7,__StackPtr(A4)    Save stack ptr
  316. X
  317. X*------ get the address of our task
  318. X    suba.l    a1,a1
  319. X    jsr    _LVOFindTask(a6)
  320. X    move.l    d0,a3
  321. X
  322. X*------ are we running as a son of Workbench?
  323. X    move.l    pr_CurrentDir(A3),_curdir(A4)
  324. X    tst.l    pr_CLI(A3)
  325. X    beq    exit4            Not supported
  326. X
  327. X    move.l    a5,D0            Get top of stack
  328. X    sub.l    4(a5),D0        compute bottom 
  329. X    move.l    D0,__base(A4)        save for stack checking
  330. X
  331. X*------ attempt to open DOS library:
  332. X    lea    DOSName(pc),A1
  333. X    moveq.l    #0,D0
  334. X    jsr    _LVOOpenLibrary(a6)
  335. X    move.l    D0,_DOSBase(A4)
  336. X    bne.s    DOSok
  337. X    moveq.l    #100,d0
  338. X    bra.s    exit2
  339. XDOSok
  340. X*------ find command name:
  341. X    move.l    pr_CLI(a3),a0
  342. X    add.l    a0,a0            bcpl pointer conversion
  343. X    add.l    a0,a0
  344. X    move.l    cli_CommandName(a0),a1
  345. X    add.l    a1,a1            bcpl pointer conversion
  346. X    add.l    a1,a1
  347. X
  348. X*------ collect parameters:
  349. X    move.l    d2,d0            get command line length
  350. X    moveq.l    #0,d1
  351. X    move.b    (a1)+,d1
  352. X    move.l    a1,__ProgramName(A4)
  353. X    add.l    d1,d0            add length of command name
  354. X    addq.l    #1,d0            allow for space after command 
  355. X
  356. X    clr.w    -(A7)            set null terminator for command line
  357. X    addq.l    #1,D0            force to even number of bytes
  358. X    andi.w    #$fffe,D0        *(round up)
  359. X    sub.l    D0,A7            make room on stack for command line
  360. X    subq.l    #2,D0
  361. X    clr.w    0(A7,D0)
  362. X
  363. X*------ copy command line onto stack
  364. X    move.l    d2,d0            get command line length
  365. X    subq.l    #1,d0
  366. X    add.l    d1,d2
  367. X
  368. Xcopy_line:
  369. X    move.b    0(A2,D0.W),0(A7,D2.W)    copy command line to stack
  370. X    subq.l    #1,d2
  371. X    dbf    d0,copy_line
  372. X    move.b    #' ',0(a7,d2.w)        add space between command and parms
  373. X    subq.l    #1,d2
  374. X
  375. Xcopy_cmd:
  376. X    move.b    0(a1,d2.w),0(a7,d2.w)    copy command name to stack
  377. X    dbf    d2,copy_cmd
  378. X    move.l    A7,A1
  379. X    move.l    A1,-(A7)        push command line address
  380. X
  381. X    lea.l    Asterix(pc),a0
  382. X    move.l    a0,d1
  383. X    move.l    #MODE_OLDFILE,d2
  384. X    move.l    _DOSBase(A4),a6
  385. X    jsr    _LVOOpen(a6)
  386. X    move.l    d0,_ConOut(a4)
  387. X    beq.s    exit4
  388. X
  389. Xmain    jsr    __main(PC)        call C entrypoint
  390. X*    moveq.l #0,d0            set successful status
  391. X    bra.s    exit2
  392. X
  393. X
  394. X_XCEXIT:
  395. X    move.l    4(SP),d0        extract return code
  396. Xexit2:
  397. X    move.l    d0,-(a7)
  398. X    move.l    __ONEXIT(A4),d0        exit trap function?
  399. X    beq.s    exit3
  400. X    move.l    d0,a0
  401. X    jsr    (a0)
  402. X
  403. Xexit3    move.l    _ConOut(a4),d1
  404. X    move.l    _DOSBase(A4),a6
  405. X    jsr    _LVOClose(a6)
  406. X
  407. Xexit4    move.l    AbsExecBase.W,a6
  408. X    move.l    _DOSBase(A4),a1
  409. X    jsr    _LVOCloseLibrary(a6)    close Dos library
  410. X
  411. XexitToDOS:
  412. X    move.l    (a7)+,d0
  413. X    movea.l    __StackPtr(a4),SP    restore stack ptr
  414. X    movem.l    (a7)+,d1-d6/a0-a6
  415. X    rts
  416. X
  417. XDOSName    dc.b    'dos.library',0
  418. XAsterix    dc.b    '*',0
  419. X
  420. X*-----------------------------------------------------------------------
  421. X
  422. X    csect    __MERGED,1,,2,2
  423. X
  424. X    xref    _DOSBase
  425. X
  426. X    xdef    _SysBase,_LoadAddress
  427. X    xdef    _curdir,__mbase,__mnext,__msize,__tsize
  428. X    xdef    __oserr,__OSERR,__FPERR,__SIGFPE,__ONERR,__ONEXIT,__ONBREAK
  429. X    xdef    __SIGINT,__ECS
  430. X    xdef    __ProgramName,__StackPtr,__base
  431. X    xdef    _ConOut
  432. X
  433. X_ConOut        ds.l    1
  434. X__base        ds.l    1        base of stack
  435. X__mbase        ds.l    1        base of memory pool
  436. X__mnext        ds.l    1        next available memory location
  437. X__msize        ds.l    1        size of memory pool
  438. X__tsize        ds.l    1        total size?
  439. X__oserr        equ    *
  440. X__OSERR        ds.l    1
  441. X__FPERR        ds.l    1
  442. X__SIGFPE    ds.l    1
  443. X__SIGINT    ds.l    1
  444. X__ONERR        ds.l    1
  445. X__ONEXIT    ds.l    1
  446. X__ONBREAK    ds.l    1
  447. X__ECS        ds.l    1        extended character set flag
  448. X_curdir        ds.l    1
  449. X_console_dev    ds.l    1
  450. X_SysBase    ds.l    1
  451. X_LoadAddress    ds.l    1        program load address
  452. X__StackPtr    ds.l    1
  453. X__ProgramName    ds.l    1
  454. X
  455. X    END
  456. X    
  457. SHAR_EOF
  458. echo "extracting execute.me"
  459. sed 's/^X//' << \SHAR_EOF > execute.me
  460. ; These two lines were added for USENET/mail transmission.  You must remove
  461. ; them, then join the lines that end in "0" with the text on their next line.
  462. remove this line and
  463. Xprintfx execute.me -l0p7
  464. X;                                              89012345678901234567890
  465. X123456789012345678901234
  466. X; This should use one sheet of paper.          89012345678901234567890
  467. X1234567890123456789012345
  468. X; If not, you have to throw this program away  89012345678901234567890
  469. X12345678901234567890123456
  470. X; Or to adapt the source. I'm sorry.           89012345678901234567890
  471. X123456789012345678901234567
  472. X;                                              89012345678901234567890
  473. X1234567890123456789012345678
  474. X; 34567890123456789012345678901234567890123456789012345678901234567890
  475. X12345678901234567890123456789
  476. SHAR_EOF
  477. echo "extracting explain.a"
  478. sed 's/^X//' << \SHAR_EOF > explain.a
  479. X    INCLUDE    "exec/types.i"
  480. X    INCLUDE    "libraries/dos.i"
  481. X    INCLUDE    "libraries/dos_lib.i"
  482. X
  483. XNEWLINE    equ    $0a
  484. X
  485. X    xdef    _Explain,_ConMsg,_ErrMsg,StrLen,_strlen
  486. X
  487. X    CSECT    text,0,0,1,2
  488. X
  489. X_Explain
  490. X    tst.b    _Er(a4)
  491. X    beq.s    Rtn
  492. X    lea.l    ExplMsg1(pc),a0
  493. X    bsr.s    WrtCon
  494. X    move.l    _Pr(a4),a0
  495. X    bsr.s    WrtCon
  496. X    lea.l    ExplMsg2(pc),a0
  497. X    bra.s    WrtCon
  498. X_ConMsg
  499. X    move.l    4(a7),a0
  500. X    bra.s    WrtCon
  501. X_ErrMsg
  502. X    tst.b    _Er(a4)
  503. X    beq.s    Rtn
  504. X    move.l    _Pr(a4),a0
  505. X    bsr.s    WrtCon
  506. X    lea.l    Colon(pc),a0
  507. X    bsr.s    WrtCon
  508. X    move.l    4(a7),a0
  509. X    bsr.s    WrtCon
  510. X    move.l    8(a7),a0
  511. X    bsr.s    WrtCon
  512. X    lea.l    NewLine(pc),a0
  513. X
  514. XWrtCon    movem.l    d2/d3,-(a7)
  515. X    move.l    a0,d2
  516. X    bsr.s    StrLen
  517. X    move.l    d0,d3
  518. X    move.l    _ConOut(a4),d1
  519. X    move.l    _DOSBase(a4),d6
  520. X    jsr    _LVOWrite(a6)
  521. X    movem.l    (a7)+,d2/d3
  522. XRtn    rts
  523. X
  524. X_strlen    move.l    4(a7),a0
  525. XStrLen    moveq.l    #-1,d0
  526. XCount    addq.l    #1,d0
  527. X    tst.b    (a0)+
  528. X    bne.s    Count
  529. X    rts
  530. X
  531. XExplMsg1
  532. X  dc.b 'Syntax:   ',0
  533. XExplMsg2
  534. X  dc.b ' [<source>]',NEWLINE
  535. X  dc.b 'Function: initiate FX-80+ printer and print file ',NEWLINE
  536. X  dc.b 'Options:',NEWLINE
  537. X  dc.b '    -s    no output via stderr',NEWLINE
  538. X  dc.b '    -l<i>    left margin (5)',NEWLINE
  539. X  dc.b '    -r<i>    right margin (max)',NEWLINE
  540. X  dc.b '    -x    donot truncate',NEWLINE
  541. X  dc.b '    -p<i>    lines per page (auto)',NEWLINE
  542. X  dc.b '    -n<i>    linespace in dots/3 (29)',NEWLINE
  543. X  dc.b '    -m<i>    printer mode, overruling other settings (see manual)',NEWLINE
  544. X  dc.b '    -q    low height, superscript',NEWLINE
  545. X  dc.b '    -el    elite (default)',NEWLINE
  546. X  dc.b '    -p    pica',NEWLINE
  547. X  dc.b '    -c    condensed',NEWLINE
  548. X  dc.b '    -en    enlarged',NEWLINE
  549. X  dc.b '    -em    emphasized',NEWLINE
  550. X  dc.b '    -d    double strike',NEWLINE
  551. X  dc.b '    -v    variable pitch (proportional)',NEWLINE
  552. X  dc.b '    -i<i>    paperlength in inches (11)',NEWLINE
  553. X  dc.b '    -ed    paper end detection off',NEWLINE
  554. X  dc.b '    -y    donot adjust paper',NEWLINE
  555. X  dc.b '    -t[<your special title>]  print title',NEWLINE
  556. X  dc.b '    -o    output is standard',NEWLINE
  557. X  dc.b 0
  558. X
  559. XColon    dc.b    ': ',0
  560. XNewLine dc.b    NEWLINE,0
  561. X
  562. X    xref    _Er,_ConOut,_DOSBase,_Pr
  563. X
  564. X
  565. X    END
  566. X
  567. SHAR_EOF
  568. echo "extracting offswitch.a"
  569. sed 's/^X//' << \SHAR_EOF > offswitch.a
  570. X*  Here three routines are defined: MakeOffswitch, TestOffSwitch and
  571. X*  RemOffSwitch. They exist to replace the keyboard abort ^C by a kind of
  572. X*  push button, labeled with the programname. So programs running in the
  573. X*  background are easy reachable and you can/must use your own closing
  574. X*  down. Must perhaps, because you MUST call RemOffSwitch before
  575. X*  termination, otherwise the window exits forever and every push on the
  576. X*  offswitch withdraws 56 bytes of the pool.
  577. X*  MakeOffSwitch() may be used to make one window. Subsequent calls just
  578. X*  return the (already existing) window pointer.
  579. X*  
  580. X
  581. X*    nolist        
  582. X    ifnd    ifiles
  583. Xifiles    set    1
  584. X    include    "exec/types.i"
  585. X    include    "intuition/intuition.i"
  586. X    endc
  587. X*    list
  588. X
  589. XLEFT    equ    640/2            Middle of the screen
  590. XTOP    equ    0
  591. XWIDTH    equ    640/2            Half a screen
  592. XHEIGHT    equ    10            Normal dragbar height
  593. X
  594. X    xdef    _MakeOffSwitch,MakeOffSwitch
  595. X    xdef    _TestOffSwitch,TestOffSwitch
  596. X    xdef    _RemOffSwitch,RemOffSwitch
  597. X
  598. X    xref    _LVOOpenLibrary
  599. X    xref    _LVOOpenWindow
  600. X    xref    _LVOGetMsg
  601. X    xref    _LVOReplyMsg
  602. X    xref    _LVOCloseWindow
  603. X    xref    _LVOCloseLibrary
  604. X
  605. X_AbsExecBase    equ    4
  606. X
  607. X    csect    OffSwitch,0,0,1,2
  608. X
  609. X*
  610. X*  From C:
  611. X*  if (MakeOffSwitch(Title)!=NULL)  /* then there is a window! */
  612. X*  else  /* there is no window, but further no problem */
  613. X*  Title is a pointer to a '\0' terminated string.
  614. X*  MakeOffSwitch returns a pointer to the Window structure. Ignore it
  615. X*  or use it, perhaps to change the window. However you may not remove it.
  616. X*
  617. X*  Intuition is opened, but when the OpenWindow fails, intuition is closed
  618. X*  immediate. So if this routine returns NULL, it is not necesary to call
  619. X*  RemOffSwitch, although this would cause no problem.
  620. X*
  621. X
  622. X_MakeOffSwitch:
  623. X    move.l    4(a7),a0
  624. XMakeOffSwitch:
  625. X    move.l    a0,Title(a4)        Text in bar into NewWindow-$
  626. X    move.l    a6,-(a7)        Keep callers a6
  627. X    move.l    Wind(a4),d0        See if there is already a window
  628. X    bne.s    QMOS            Yes, return its pointer
  629. X    move.l    IBase(a4),d0        See if Intuition is already open
  630. X    bne.s    GotI
  631. X    move.l    _AbsExecBase,a6        Get Exec-function pointer
  632. X    lea.l    IntuName(pc),a1        "intuition.library"
  633. X    moveq.l    #0,d0            Any version is OK
  634. X    jsr    _LVOOpenLibrary(a6)    Get Intuition library
  635. X    move.l    d0,IBase(a4)        Keep for later
  636. X    beq.s    QMOS            No intu; no window
  637. XGotI    move.l    d0,a6            Get intu pointer
  638. X    lea.l    NewWind(a4),a0        Get NewWindow structure
  639. X    jsr    _LVOOpenWindow(a6)    Open a window
  640. X    move.l    d0,Wind(a4)        Keep pointer, so we can close it
  641. X    beq.s    CloseI            No window, Intu of no use
  642. XQMOS    move.l    (a7)+,a6        Restore callers a6
  643. X    rts
  644. X
  645. X*
  646. X*  From C:
  647. X*  if (TestOffSwitch()!=0)  /* then close gadget was stirred */
  648. X*  else  /* close gadged was passed */
  649. X*  This may be done more then once, the message is just passed.
  650. X*
  651. X*  Even if there is no window,  it is allowed to call this routine. 
  652. X*  Then it just returns zero.
  653. X*
  654. X
  655. X_TestOffSwitch:
  656. XTestOffSwitch:
  657. X    move.l    a6,-(a7)        Keep callers a6
  658. X    move.l    _AbsExecBase,a6        Get Exec-function pointer
  659. X    move.l    Wind(a4),d0        Get Window-$
  660. X    beq.s    QTOS            If none quit
  661. X    move.l    d0,a1            We need a member so use a-reg
  662. X    move.l    wd_UserPort(a1),a0    Get connection to our window
  663. X    jsr    _LVOGetMsg(a6)        See if ther's a message
  664. X    tst.l    d0            non-zero is truly a message
  665. X    beq.s    QTOS            zero means no message
  666. X    move.l    d0,a1            a1 is used to reply
  667. X    move.l    im_Class(a1),-(a7)    Keep interesting part of mess
  668. X    jsr    _LVOReplyMsg(a6)    Return message ownership
  669. X    move.l    (a7)+,d0        Get interesting part
  670. X    cmp.l    #CLOSEWINDOW,d0        We look only for closewindow
  671. X    bne.s    QZero            If not we return zero
  672. XQTOS    move.l    (a7)+,a6        If true we return CLOSEWINDOW
  673. X    rts
  674. X
  675. X*
  676. X*  From C:
  677. X*  RemOffSwitch();   /* removes the window */
  678. X*
  679. X*  Even if there was no window, it is allowed to call this routine.
  680. X*
  681. X    
  682. X_RemOffSwitch:
  683. XRemOffSwitch:
  684. X    move.l    a6,-(a7)        Save callers a6
  685. X    move.l    IBase(a4),d0        Get key to intuition
  686. X    beq.s    QROS            If none asume ready
  687. X    move.l    d0,a6            a6 is used to enter intuition
  688. X    move.l    Wind(a4),d0        Get window structure
  689. X    beq.s    CloseI            If none close intuition
  690. X    move.l    d0,a0            A0 is parameter port
  691. X    jsr    _LVOCloseWindow(a6)    Close our window
  692. X    clr.l    Wind(a4)        Aint that nice?
  693. XCloseI    move.l    a6,a1            A1 is parameter port
  694. X    move.l    _AbsExecBase,a6        Get key to Exec
  695. X    jsr    _LVOCloseLibrary(a6)    Close intuition
  696. X    clr.l    IBase(a4)        There is NO intuition anymore..
  697. XQZero    moveq.l    #0,d0            This routine always returns 0
  698. XQROS    move.l    (a7)+,a6        Callers a6
  699. X    rts
  700. X    
  701. XIntuName dc.b 'intuition.library',0
  702. X
  703. X    csect    __MERGED,1,,2,2
  704. X
  705. X***  The NewWindow structure
  706. X
  707. XNewWind dc.w    LEFT,TOP,WIDTH,HEIGHT
  708. X    dc.b    -1,-1
  709. X    dc.l    CLOSEWINDOW
  710. X    dc.l    WINDOWDRAG!WINDOWCLOSE!WINDOWDEPTH
  711. X    dc.l    0,0
  712. XTitle    dc.l    0
  713. X    dc.l    0,0
  714. X    dc.w    0,0,0,0
  715. X    dc.w    WBENCHSCREEN
  716. X    
  717. XWind    ds.l    1
  718. XIBase    ds.l    1
  719. X
  720. X    end
  721. SHAR_EOF
  722. echo "extracting printfx.c"
  723. sed 's/^X//' << \SHAR_EOF > printfx.c
  724. Xchar *Cr="PrintFx 2.7  09-MAY-89 by D.W.Reisig, NL 1151AV10\n";
  725. Xchar *WTTl=" PrintFx 2.7 ";
  726. X
  727. X/*
  728. X
  729. XThis code is a good example how NOT to write a program. Then why
  730. Xdid I include the source?
  731. XThis is a utility that I made when I had the Amiga one month or so.
  732. XAnd I could not get my files to my printer without printing over
  733. Xthe perforation, or it stopped halfway the sheet when the printing
  734. Xwas done. Annyway I got irritated.
  735. XI have an Epson FX80+. I thought that made this program useless
  736. Xfor other printers. Suddenly the hole world can use it on their
  737. Xprinters as well. This is why I included the source. Perhaps it
  738. Xdoes not work on your printer. Now you can change it (if you can
  739. Xdecipher the code).
  740. XI used Lattice 5.02 and Asm 5.02 as compilers but 4.00 does it also
  741. Xfine.
  742. X
  743. X*/
  744. X
  745. X
  746. X#include <libraries/dos.h>
  747. X#include <setjmp.h>>
  748. X#include <exec/types.h>
  749. X#include <intuition/intuition.h>
  750. X
  751. X#define CMDNAMES 1    /* one inputfile                 */
  752. X#define ISM 64        /* init string max                */
  753. X#define IOBUFFER 512    /* twice allocated from the stack        */
  754. X#define RMARGINIT 255    /* means: not used                */
  755. X#define UNIT_INCH 216    /* there are 216 1/3 units in a inch        */
  756. X#define EOF -1        /*                        */
  757. X#define ESC 0x1b    /*                        */
  758. X#define SKIPOVERA 198    /* skip-over space in 1/3 dots if back shift    */
  759. X#define SKIPOVERB 264   /* skip-over space if not shifted back        */
  760. X#define PERFSHIFT 54    /* paper shift back at start in 1/3 dots    */
  761. X#define ERROR -1    /* Used with longjump in an error situation    */
  762. X#define    STOP 1        /* Used with longjump in a non error situation    */
  763. X
  764. Xjmp_buf Mains;        /* easy does it                    */
  765. Xchar DeinitPaper[]={ ESC,'J',PERFSHIFT,ESC,'C',0,0 } ;
  766. X#define DEINITLEN 7    /* size of DeinitPaper[]            */
  767. Xchar *Path[CMDNAMES+1];
  768. Xchar *Title=NULL;    /* title available                */
  769. Xint  Infile;        /* DOS file handler                */
  770. Xint  Prt;        /* DOS file handler                */
  771. Xint  Page=0;        /* printer determines pagelength        */
  772. Xint  Lmarg=5;        /* left margin                    */
  773. Xint  Rmarg=RMARGINIT;    /* right margin not given            */
  774. Xint  Cpline;        /* will contain number of possible chars/line    */
  775. Xint  Mode=64;        /* 64=unused                    */
  776. Xint  Lsp=29;        /* Linespace .13456" 3.41mm 82 l/p        */
  777. Xint  Type=1;        /* type is elite                */
  778. Xint  Plen=11;        /* paper length    in inches            */
  779. Xint  SpPTab=8;        /* Spaces per Tab (make an option of it iyl    */
  780. Xchar *Pr;        /* Name of this utility from cmdline        */
  781. Xchar Cond=0;        /* not condensed                */
  782. Xchar Empha=0;        /* not emphasized                */
  783. Xchar Double=0;        /* not double strike                */
  784. Xchar Prop=0;        /* not proportional                */
  785. Xchar Super=0;        /* super script is off                */
  786. Xchar Trunc=1;        /* truncation line overflow            */
  787. Xchar PlBack=1;        /* paper is pulled back at start        */
  788. Xchar EndDet=1;        /* paper end detection on            */
  789. Xchar OutStd=0;        /* Output not standard; PAR:            */
  790. Xchar Let='\f';        /* last character send to printer, if it is FF,    */
  791. X            /* no extra FF must be sent, and no FF if    */
  792. X            /* nothing has been printed            */
  793. Xchar Er=1;        /* stderr may be used                */
  794. X
  795. Xvoid ps(),ErrMsg(),Explain();
  796. Xchar gc();
  797. Xextern int ConOut;
  798. X
  799. X
  800. Xmain(argc,argv)
  801. Xregister int argc;
  802. Xregister char *argv[];
  803. X{
  804. X  register int argcnt, namecnt, ret, err=0;
  805. X
  806. X  Pr=argv[0];  /* adapt name the user uses */
  807. X  if (argc>1){
  808. X    if (*argv[1]=='?'){
  809. X      Explain();
  810. X      return(0);
  811. X    }
  812. X  }
  813. X  for (argcnt=1,namecnt=0;argcnt<argc;++argcnt) if (*(argv[argcnt])!='-'){
  814. X    Path[namecnt++]=argv[argcnt];
  815. X    if (namecnt>CMDNAMES) break;
  816. X  }
  817. X  procopts(argc,argv);
  818. X  if (namecnt>CMDNAMES){
  819. X    ErrMsg("Donot know what to do with: ",Path[CMDNAMES]);
  820. X    return(0);
  821. X  }
  822. X  if (calc()) return(0); /* some things must be calculated */
  823. X
  824. X  if (Path[0]){
  825. X    if ((Infile=Open(Path[0],MODE_OLDFILE))==0){
  826. X      ErrMsg("Cannot open: ",Path[0]);
  827. X      return(0);
  828. X    }
  829. X  } else Infile=Input();
  830. X  if (!OutStd){
  831. X    if ((Prt=Open("PAR:",MODE_OLDFILE))==0){
  832. X      ErrMsg("No printer (PAR:)","");
  833. X      goto CleanUp;
  834. X    }
  835. X  } else Prt=Output();
  836. X  ret=setjmp(Mains);    /* return point from deep level errors */
  837. X  if (ret) goto CleanUp;
  838. X  MakeOffSwitch(WTTl);  /* nice to stop when you did RUN pr.. */
  839. X
  840. X  initprinter();
  841. X  filetoprinter();
  842. X  deinitprinter();
  843. X  goto CleanUp1;
  844. X
  845. XCleanUp:
  846. X  if (ret==ERROR)  err=IoErr();
  847. X
  848. XCleanUp1:
  849. X  RemOffSwitch();
  850. X  if (!OutStd)  Close(Prt);
  851. X  if (Path[0])  Close(Infile);
  852. X  return(err);
  853. X}   /* main */
  854. X
  855. X
  856. Xprocopts(argc,argv)
  857. Xregister int argc;
  858. Xregister char *argv[];
  859. X{
  860. X  register int argcnt;
  861. X  register char *option, *error, avail;
  862. X  int temp;
  863. X  for (argcnt=1;argcnt<argc;++argcnt){
  864. X    if (*(option=argv[argcnt])=='-'){
  865. X      avail=1;
  866. X      while (avail) switch(*(error=option++)){
  867. X
  868. Xcase '-'  : break;
  869. Xcase '\0' : avail=0; break;
  870. Xcase '?'  : if (*option=='?') ConMsg(Cr); else Explain();  XCEXIT(0);
  871. Xcase 't'  : Title  =(*option=='=')?option+1:option; avail=0; break;
  872. Xcase 'i'  : option+=stoi(option,&Plen);   break;
  873. Xcase 'l'  : option+=stoi(option,&Lmarg);  break;
  874. Xcase 'r'  : option+=stoi(option,&Rmarg);  break;
  875. Xcase 'p'  : option+=stoi(option,&temp);
  876. X            if (temp==0) Type&=0xfe;
  877. X            else Page=temp;
  878. X            break;
  879. Xcase 'm'  : option+=stoi(option,&Mode);   break;
  880. Xcase 'n'  : option+=stoi(option,&Lsp);    break;
  881. Xcase 'c'  : Type|=0x04;  break;
  882. Xcase 'e'  : switch(*(option++)){
  883. X              case 'd' : EndDet=0;    break;
  884. X              case 'l' : Type|=0x01;  break;
  885. X              case 'm' : Type|=0x08;  break;
  886. X              case 'n' : Type|=0x20;  break;
  887. X              default  : goto opterr;
  888. X            }
  889. Xcase 'd'  : Type|=0x10;  break;
  890. Xcase 'v'  : Prop=1;      break;
  891. Xcase 'x'  : Trunc=0;     break;
  892. Xcase 'y'  : PlBack=0;     break;
  893. Xcase 'o'  : OutStd=1;    break;
  894. Xcase 's'  : Er=0;     break;
  895. Xcase 'q'  : Super=1;     break;
  896. Xdefault   : goto opterr;
  897. X
  898. X  } } } return(0);
  899. Xopterr:
  900. X  Explain();
  901. X  ErrMsg("Unknown option: -",error);
  902. X  XCEXIT(0);
  903. X}   /* procopts */
  904. X
  905. X
  906. Xcalc()
  907. X{
  908. X  register int choose, avail;
  909. X  register unsigned char *data;
  910. X  if (Mode==64)   Mode=Type;
  911. X  data="\x50\x60\x28\x30\x89\xA0\x44\x50";
  912. X  choose=(int)Mode&0x05;    /* b0 on is elite, b2 on is condensed */
  913. X  if (Mode&0x20) choose+=0x02;    /* b1 on is enlarged */ 
  914. X  Cpline=(int)*(data+choose);
  915. X  if (Rmarg!=RMARGINIT){
  916. X    if (Rmarg>Cpline){
  917. X      ErrMsg("Right margin too large","");
  918. X      return(-1);
  919. X    }
  920. X  } else Rmarg=Cpline;
  921. X  Cpline=Rmarg-Lmarg;
  922. X  avail=((Plen*UNIT_INCH)-((PlBack)?SKIPOVERA:SKIPOVERB))/Lsp;
  923. X  if (Page){
  924. X    if (Page>avail){
  925. X      ErrMsg("You ask too much lines per page","");
  926. X      return(-1);
  927. X    }
  928. X  } else Page=avail;
  929. X  return(0);
  930. X}
  931. X
  932. X
  933. Xinitprinter()
  934. X{
  935. X  char initstring[ISM];
  936. X  register char *is=initstring;
  937. X  register int len;
  938. X
  939. X  if (PlBack){
  940. X    *(is++)=ESC;   *(is++)='j';   *(is++)=PERFSHIFT;
  941. X  }
  942. X  *(is++)=ESC;   *(is++)='@';
  943. X  *(is++)=ESC;   *(is++)='C';   *(is++)=0;     *(is++)=Plen;
  944. X  *(is++)=ESC;   *(is++)='!';   *(is++)=Mode;
  945. X  if (Prop)    { *(is++)=ESC;   *(is++)='p';   *(is++)='1';    }
  946. X  *(is++)=ESC;   *(is++)=EndDet?'9':'8';  
  947. X  *(is++)=ESC;   *(is++)='3';   *(is++)=Lsp;
  948. X  if (Lmarg)   { *(is++)=ESC;   *(is++)='l';   *(is++)=Lmarg;  }
  949. X  *(is++)=ESC;   *(is++)='Q';   *(is++)=Rmarg;
  950. X  if (Super)   { *(is++)=ESC;   *(is++)='S';   *(is++)='0';    }
  951. X  
  952. X  len=is-initstring;
  953. X  if (Write(Prt,initstring,len)!=len) longjmp(Mains,ERROR);
  954. X  return(0);
  955. X}
  956. X
  957. X
  958. Xdeinitprinter()
  959. X{
  960. X  if (Let!='\f') if (Write(Prt,"\f",1)!=1) longjmp(Mains,ERROR);
  961. X  if (PlBack){
  962. X    DeinitPaper[DEINITLEN-1]=Plen;  /* FF button works ok now */
  963. X    if (Write(Prt,DeinitPaper,DEINITLEN)!=DEINITLEN) longjmp(Mains,ERROR);
  964. X  }
  965. X  return(0);
  966. X}
  967. X
  968. X
  969. X
  970. Xchar *Inb, *Outb;  /* two buffer pointer global from here on */
  971. X
  972. X
  973. Xfiletoprinter()
  974. X{
  975. X  char inbuffer[IOBUFFER], outbuffer[IOBUFFER];  /* from the stack */
  976. X  register int line, i;
  977. X  register char c;
  978. X  
  979. X  Inb=inbuffer; Outb=outbuffer;
  980. X
  981. X  i=Lmarg;  
  982. X  line=newpage();
  983. X  while (1){
  984. X    c=gc();
  985. Xcheck:
  986. X    if (c=='\t') i+=(SpPTab-((i-Lmarg)%SpPTab));  /* expand tabs */
  987. X    else ++i;
  988. X    if (c=='\n'){                   /* newline */
  989. X      i=Lmarg;
  990. X      line=newline(line);
  991. X    } else if (c=='\f'){            /* formfeed, newline inherent */
  992. X      i=Lmarg;
  993. X      line=newpage(line);
  994. X    } else if (i>Rmarg){            /* R-marge reached: newline */
  995. X      i=Lmarg;
  996. X      line=newline(line);
  997. X      if (Trunc) trunc();           /* skip rest of line  */
  998. X      else goto check;              /* no, print rest on next line */
  999. X    } else pc(c);
  1000. X    if (c==EOF) break;
  1001. X  }
  1002. X  return(0);  
  1003. X}
  1004. X
  1005. X
  1006. Xnewline(line)
  1007. Xregister int line;
  1008. X{
  1009. X  ++line;
  1010. X  if (line>=Page)  line=newpage();
  1011. X  else  pc('\n');
  1012. X  return(line);
  1013. X}
  1014. X
  1015. X
  1016. Xtrunc()
  1017. X{
  1018. X  char t;
  1019. X  while ((t=gc())>=0) if (t=='\n') break;
  1020. X  return(0);
  1021. X}
  1022. X
  1023. X
  1024. Xnewpage()
  1025. X{
  1026. X  static pagenr=0;
  1027. X  register out, factor, tpagenr, nr;
  1028. X  char ptd;
  1029. X  if ((pagenr)&&(Let!='\f')) ps("\r\f");
  1030. X  ++pagenr;
  1031. X  if (Title){
  1032. X    out=0;
  1033. X    ps("page "); out+=5;
  1034. X    for (tpagenr=pagenr,factor=1000,ptd=0;factor;factor/=10){
  1035. X      if (nr=(tpagenr/factor)) ptd=1;
  1036. X      if (ptd){
  1037. X        pc(nr+0x30);
  1038. X        ++out;
  1039. X    tpagenr-=(nr*factor);
  1040. X      }
  1041. X    }
  1042. X    for (;out<10;++out) pc(' ');
  1043. X    ps(Title); out+=strlen(Title);
  1044. X    factor=Cpline-strlen(Path[0])-Lmarg;
  1045. X    while (out++<factor) pc(' ');
  1046. X    ps(Path[0]);
  1047. X    ps("\n\n");
  1048. X    return(2); /* now two lines used */
  1049. X  }
  1050. X  return(0); /* no title; no lines used */
  1051. X}
  1052. X    
  1053. X  
  1054. X
  1055. Xchar gc()  /* return a char, if buffer empty ask dos for more */
  1056. X{
  1057. X  static avail=0, pos=0;
  1058. X  
  1059. X  if (avail==0){
  1060. X    if ((avail=Read(Infile,Inb,IOBUFFER))<1){
  1061. X      if (avail<0) longjmp(Mains,ERROR);
  1062. X      return(EOF);
  1063. X    }
  1064. X    pos=0;
  1065. X  }
  1066. X  --avail;
  1067. X  return(*(Inb+pos++));
  1068. X} /* gc */
  1069. X
  1070. X
  1071. Xvoid ps(string)
  1072. Xregister char *string;
  1073. X{
  1074. X  while (*string) pc(*(string++));
  1075. X}
  1076. X
  1077. X
  1078. Xpc(c)  /* store a char, if buffer full, flush it */
  1079. Xchar c;
  1080. X{
  1081. X  static pos=0;
  1082. X
  1083. X  if (c!=EOF){
  1084. X    Let=*(Outb+pos++)=c;
  1085. X    if (pos<IOBUFFER) return(0);
  1086. X  }
  1087. X  if ((TestOffSwitch())||(SetSignal(0,0x3000)&0x3000)){
  1088. X    deinitprinter();
  1089. X    longjmp(Mains,STOP);
  1090. X  }
  1091. X  if (Write(Prt,Outb,pos)!=pos) longjmp(Mains,ERROR);
  1092. X  pos=0;
  1093. X  return(0);
  1094. X} /* pc */
  1095. X
  1096. SHAR_EOF
  1097. echo "extracting printfx.doc"
  1098. sed 's/^X//' << \SHAR_EOF > printfx.doc
  1099. XPrintfx is written to control an Epson FX-80+. Back in 1986, I could not
  1100. Xget my files printed in an easy way, so blinkers on and jam the code
  1101. Xtogether.  Recently my friends discovered the piece and suggessed that
  1102. Xit might work on other printers as well. They reported positive. So here
  1103. Xit is. Maybe it does not work properly on your printer. Don't blame me.
  1104. XWell, I included the source, so perhaps...  Use it a you like.
  1105. X
  1106. XNow I will descibe the switches.
  1107. X    
  1108. X    -?    Give explanation how to use it. If this option is met
  1109. X        anywhere on the commandline, the only thing the program
  1110. X        does, is to give that explanation.
  1111. X
  1112. X    -s    no output via stderr
  1113. X        No error messages if you dont want them.
  1114. X        Is overuled by -? and -??
  1115. X
  1116. X    -l<i>    left margin (5)
  1117. X        Default left margin is 5. Tabs are expanded without
  1118. X        including this value. A tab on colum 1 expands to
  1119. X        position 13 on the printer.
  1120. X
  1121. X    -r<i>    right margin (max)
  1122. X        Default is the last char that the FX-80+ can print
  1123. X        with the present pitch.
  1124. X        
  1125. X    -x    donot truncate
  1126. X        Default is that lines longer than the right margin minus
  1127. X        the left margin are truncated.
  1128. X        
  1129. X    -p<i>    lines per page (auto)
  1130. X        Default the maximum number of lines are printed on a
  1131. X        page, using the linespace as source. But you can select
  1132. X        to formfeed every pth line.
  1133. X        
  1134. X    -n<i>    linespace in dots/3 (29)
  1135. X        This number is in 1/216th inch. Three of this units is
  1136. X        the vertical size of a dot.
  1137. X
  1138. X    -m<i>    printer mode, overruling other settings (see manual)
  1139. X        This is the value behind ESC!. Precede by '%' if you
  1140. X        give it in bynary, '$' if hex and '@' if octal. Donot
  1141. X        use it.
  1142. X
  1143. X    -q    low height, superscript
  1144. X        Now you can print a lot on a page! (27040 chars) Use it
  1145. X        together with -n=15 or 14 and -c.
  1146. X
  1147. X    -el    elite (default)
  1148. X        I do not know why printers use this this as default. I
  1149. X        never use pica.
  1150. X        
  1151. X    -p    pica
  1152. X        If you are in a hurry use this ugly pitch.
  1153. X        
  1154. X    -c    condensed
  1155. X        Narrows the characters.
  1156. X        
  1157. X    -en    enlarged
  1158. X        Stretches the characters
  1159. X        
  1160. X    -em    emphasized
  1161. X        I donot see difference with -d (And my profession is
  1162. X        printer!! (but perhaps a bad one))
  1163. X        
  1164. X    -d    double strike
  1165. X        Does something like emphasize.
  1166. X
  1167. X    -v    variable pitch (proportional)
  1168. X        Could be nice, but works only with that ugly pica.
  1169. X
  1170. X    -i<i>    paperlength in inches (11)
  1171. X    
  1172. X    -ed    paper end detection off
  1173. X        Use this when you want to print a single sheet more than
  1174. X        only the upper half
  1175. X        
  1176. X    -y    donot adjust paper
  1177. X        I like to start printing higher as normal, so the paper
  1178. X        is pulled back as much as possible. But this causes a jam
  1179. X        on a nonmodified FX-80+. You must fill the guide with those
  1180. X        two rolls with extra rolls. You can use 2 cm pieces of 8mm
  1181. X        high pressure tube.
  1182. X        
  1183. X    -t[<your special title>]  print title
  1184. X        The path and page number are printed as well as your title,
  1185. X        if given. Use "" for titles with spaces:
  1186. X        "-t=your special title" Leave a space behind this option
  1187. X        and others.
  1188. X
  1189. X    -o    output is standard
  1190. X        Use this to sent the file to standard output instead of PAR:
  1191. X
  1192. X
  1193. X
  1194. XIf the printing job is done, the printer is left in the last used mode.
  1195. XSo any text to PAR: is printed in the same pitch, same linespace, same
  1196. Xskip over perforation, same margins. But without control. No trucation and
  1197. Xno lines per page. (And no stop)
  1198. XThe program will not be beware of changing printer settings inside your text,
  1199. Xand may act strange if you do so.
  1200. X
  1201. XD.W.Reisig
  1202. XWoudweeren 10
  1203. X1151 AV  Broek in Waterland
  1204. XHolland
  1205. SHAR_EOF
  1206. echo "extracting printfx.n"
  1207. sed 's/^X//' << \SHAR_EOF > printfx.n
  1208. X.so an
  1209. X.TH PrintFX 1 "PrintFX manual"
  1210. X.de cmd
  1211. X!sp $1;!ne 2;!ti -5;!bo "$0
  1212. X.en
  1213. X.SH NAME
  1214. XPrintFX - EPSON compatible printer utility
  1215. X
  1216. X.SH HISTORY
  1217. X
  1218. XPrintfx is written to control an Epson FX-80+. Back in 1986, I could not
  1219. Xget my files printed in an easy way, so blinkers on and jam the code
  1220. Xtogether.  Recently my friends discovered the piece and suggested that
  1221. Xit might work on other printers as well. They reported positive. So here
  1222. Xit is. Maybe it does not work properly on your printer. Don't blame me.
  1223. XWell, I included the source, so perhaps...  Use it a you like.
  1224. X
  1225. X.SH COMMAND LINE OPTIONS
  1226. X
  1227. X.in +8;.ta +0;.cc !
  1228. X!*--------------------------*
  1229. X!cmd -?
  1230. X@tGive explanation how to use it. If this option is met
  1231. Xanywhere on the commandline, the only thing the program
  1232. Xdoes, is to give that explanation.
  1233. X!*--------------------------*
  1234. X!cmd -n
  1235. X@tno output via stderr
  1236. XNo error messages if you don't want them.
  1237. XIs overruled by -? and -??
  1238. X!*--------------------------*
  1239. X!cmd -l<i>
  1240. X@tleft margin (5)
  1241. XDefault left margin is 5. Tabs are expanded without
  1242. Xincluding this value. A tab on column 1 expands to
  1243. Xposition 13 on the printer.
  1244. X!*--------------------------*
  1245. X!cmd -r<i>
  1246. X@tright margin (max)
  1247. XDefault is the last char that the FX-80+ can print
  1248. Xwith the present pitch.
  1249. X!*--------------------------*
  1250. X!cmd -x
  1251. X@tdonot truncate
  1252. XDefault is that lines longer than the right margin minus
  1253. Xthe left margin are truncated.
  1254. X!*--------------------------*
  1255. X!cmd -p<i>
  1256. X@tlines per page (auto)
  1257. XDefault the maximum number of lines are printed on a
  1258. Xpage, using the linespace as source. But you can select
  1259. Xto formfeed every pth line.
  1260. X!*--------------------------*
  1261. X!cmd -n<i>
  1262. X@tlinespace in dots/3 (29)
  1263. XThis number is in 1/216th inch. Three of this units is
  1264. Xthe vertical size of a dot.
  1265. X!*--------------------------*
  1266. X!cmd -m<i>
  1267. X@tprinter mode, overruling other settings (see manual)
  1268. XThis is the value behind ESC!. Precede by '%' if you
  1269. Xgive it in binary, '$' if hex and '@' if octal. Donot
  1270. Xuse it.
  1271. X!*--------------------------*
  1272. X!cmd -q
  1273. X@tlow height, superscript
  1274. XNow you can print a lot on a page! (27040 chars) Use it
  1275. Xtogether with -n=15 or 14 and -c.
  1276. X!*--------------------------*
  1277. X!cmd -el
  1278. X@telite (default)
  1279. XI do not know why printers use this as default. I
  1280. Xnever use pica.
  1281. X!*--------------------------*
  1282. X!cmd -p
  1283. X@tpica
  1284. XIf you are in a hurry use this ugly pitch.
  1285. X!*--------------------------*
  1286. X!cmd -c
  1287. X@tcondensed
  1288. XNarrows the characters.
  1289. X!*--------------------------*
  1290. X!cmd -en
  1291. X@tenlarged
  1292. XStretches the characters
  1293. X!*--------------------------*
  1294. X!cmd -em
  1295. X@temphasized
  1296. XI don't see difference with -d (And my profession is
  1297. Xprinter!! (but perhaps I'm a bad one))
  1298. X!*--------------------------*
  1299. X!cmd -d
  1300. X@tdouble strike
  1301. XDoes something like emphasize.
  1302. X!*--------------------------*
  1303. X!cmd -v
  1304. X@tvariable pitch (proportional)
  1305. XCould be nice, but works only with that ugly pica.
  1306. X!*--------------------------*
  1307. X!cmd -i<i>
  1308. X@tpaperlength in inches (11)
  1309. X!*--------------------------*
  1310. X!cmd -ed
  1311. X@tpaper end detection off
  1312. XUse this when you want to print a single sheet more than
  1313. Xonly the upper half.
  1314. X!*--------------------------*
  1315. X!cmd -y
  1316. X@tdonot adjust paper
  1317. XI like to start printing higher as normal, so the paper
  1318. Xis pulled back as much as possible. But this causes a jam
  1319. Xon a nonmodified FX-80+. You must fill the guide with those
  1320. Xtwo rolls with extra rolls. You can use 2 cm pieces of 8mm
  1321. Xhigh pressure tube.
  1322. X!*--------------------------*
  1323. X!cmd -t
  1324. X@t-t[<your special title>] prints your special title.
  1325. XThe path and page number are printed as well as your title,
  1326. Xif given. Use "" for titles with spaces:
  1327. X"-t=your special title" Leave a space behind this option
  1328. Xand others.
  1329. X!*--------------------------*
  1330. X!cmd -o
  1331. X@toutput is standard
  1332. XUse this to sent the file to standard output instead of PAR:
  1333. X!*--------------------------*
  1334. X!cc
  1335. X.in -5;.PP
  1336. X
  1337. X.SH NOTES
  1338. X
  1339. XIf the printing job is done, the printer is left in the last used mode.
  1340. XSo any text to PAR: is printed in the same pitch, same linespace, same
  1341. Xskip over perforation, same margins. But without control. No trucation and
  1342. Xno lines per page (and no stop).
  1343. XThe program will not be beware of changing printer settings inside your text,
  1344. Xand may act strange if you do so.
  1345. X
  1346. X.SH AUTHOR
  1347. X
  1348. XD.W.Reisig,
  1349. XWoudweeren 10,
  1350. X1151AV  Broek in Waterland,
  1351. XHolland.
  1352. SHAR_EOF
  1353. echo "extracting printfx.uu"
  1354. sed 's/^X//' << \SHAR_EOF > printfx.uu
  1355. X
  1356. Xbegin 644 printfx
  1357. XM```#\P`````````#``````````(```0*````B@````````/I```$"DCG?OY+#
  1358. XM[P`T)$@D`$GY`````$'Y```!R'(`(#P````88`(@P5'(__PL>``$*4X`0"E/,
  1359. XM`$B3R4ZN_MHF0"EK`)@`.$JK`*QG``"R(`V0K0`$*4``!$/Z`+QP`$ZN_=@IZ
  1360. XM0`(D9@1P9&!Z(&L`K-'(T<@B:``0T\G3R2`"<@`2&2E)`$S0@5*`0F=2@`)`6
  1361. XM__Z?P%6`0G<(`"`"4X#4@1^R```@`%."4<C_]A^\`"`@`%."'[$@`"``4<K_J
  1362. XM^")/+PE!^@!>(@@D/````^TL;`(D3J[_XBE```!G(DZZ`$9@!"`O``0O`"`L!
  1363. XM`"QG!"!`3I`B+```+&P")$ZN_]PL>``$(FP")$ZN_F(@'RYL`$A,WW]^3G5D@
  1364. XM;W,N;&EB<F%R>0`J`$CG,"`D3R!O`!!#[P``=@`0$`P``"!B!F4T0AA@\@P`M
  1365. XM`")G$"\(4H,,$``@9^QE'E*(8/12B"\(4H,0$&<0#```(F?6#```"F<$4HA@(
  1366. XM[$(0($\D`^**8`@@(2(0(,`B@5'*__8B#R`/Y(AD`E6/+P$O`TZZ`M0N2DS?G
  1367. XM!`Q.=0``2BP`T&=40?H`8F$T(&P"&&$N0?H`86`H(&\`!&`B2BP`T&<V(&P"E
  1368. XM&&$60?H"E6$0(&\`!&$*(&\`"&$$0?H"ADCG,``D"&$8)@`B+```+"P")$ZN!
  1369. XM_]!,WP`,3G4@;P`$</]2@$H89OI.=5-Y;G1A>#H@("``(%L\<V]U<F-E/ET*P
  1370. XM1G5N8W1I;VXZ(&EN:71I871E($98+3@P*R!P<FEN=&5R(&%N9"!P<FEN="!F_
  1371. XM:6QE(`I/<'1I;VYS.@H)+7,);F\@;W5T<'5T('9I82!S=&1E<G(*"2UL/&D^7
  1372. XM"6QE9G0@;6%R9VEN("@U*0H)+7(\:3X)<FEG:'0@;6%R9VEN("AM87@I"@DM)
  1373. XM>`ED;VYO="!T<G5N8V%T90H)+7`\:3X);&EN97,@<&5R('!A9V4@*&%U=&\IP
  1374. XM"@DM;CQI/@EL:6YE<W!A8V4@:6X@9&]T<R\S("@R.2D*"2UM/&D^"7!R:6YTC
  1375. XM97(@;6]D92P@;W9E<G)U;&EN9R!O=&AE<B!S971T:6YG<R`H<V5E(&UA;G5A_
  1376. XM;"D*"2UQ"6QO=R!H96EG:'0L('-U<&5R<V-R:7!T"@DM96P)96QI=&4@*&1E(
  1377. XM9F%U;'0I"@DM<`EP:6-A"@DM8PEC;VYD96YS960*"2UE;@EE;FQA<F=E9`H)K
  1378. XM+65M"65M<&AA<VEZ960*"2UD"61O=6)L92!S=')I:V4*"2UV"79A<FEA8FQE1
  1379. XM('!I=&-H("AP<F]P;W)T:6]N86PI"@DM:3QI/@EP87!E<FQE;F=T:"!I;B!I!
  1380. XM;F-H97,@*#$Q*0H)+65D"7!A<&5R(&5N9"!D971E8W1I;VX@;V9F"@DM>0ED%
  1381. XM;VYO="!A9&IU<W0@<&%P97(*"2UT6SQY;W5R('-P96-I86P@=&ET;&4^72`@;
  1382. XM<')I;G0@=&ET;&4*"2UO"6]U='!U="!I<R!S=&%N9&%R9`H`.B``"@```$Y56
  1383. XM__!(YP\0+B\`+"9O`#!"K?_P*5,"&'`!OH!O%"!K``1P/[`09@I.NOT.<`!@"
  1384. XM``$H?`%Z`+R';"8@!N6`(',(`'(MLA!G%"(%Y8%2A4/L`@0CB!@`<`&Z@&X$P
  1385. XM4H9@UB\++P=A``#\4$]P`;J`;Q(O+`((2&P`TDZZ_-QP`&```-AA``,>2H!G,
  1386. XM!G``8```RDJL`@1G*$AX`^TO+`($3KH*<%!/*4`"#$J`9AHO+`($2&P`\$ZZK
  1387. XM_*!P`&```)Q.N@JX*4`"#$HL`,YF)DAX`^U(;`#^3KH*.E!/*4`"$$J`9AA(Q
  1388. XM;`$62&P!!$ZZ_&I03V`P3KH*E"E``A!(;`'(3KH(_%A/*`!*A&88+RP`EDZZ7
  1389. XM"#QA``-(80`$@&$`!!183V`.</^X@&8(3KH*;BM`__!.N@B*2BP`SF8*+RP"]
  1390. XM$$ZZ">Q83TJL`@1G"B\L`@Q.N@G<6$\@+?_P3.T(\/_<3EU.=4Y5_^Y(YP<P*
  1391. XM+B\`+B9O`#)\`;R';``"!B`&Y8`D<P@`<"VP$F8``?!Z`4H%9P`!Z"M*__12Z
  1392. XMBB!M__00$$B`<G)=06L``=RP>Q`(9O1.^Q`$`'%@``&X`'-@``&J`&]@``&:H
  1393. XM`'E@``&,`'A@``%^`'9@``%N`&1@``%>`&5@``$.`&-@``#^`&Y@``#F`&U@[
  1394. XM``#.`'!@``">`')@``"&`&Q@``!N`&E@``!6`'1@```X`#]@```4``!@```(4
  1395. XM`"U@`/]J>@!@`/]D<#^P$F8,+RP`A$ZZ^QI83V`$3KKZ^D*G3KKZ,EA/<#VPZ
  1396. XM$F8&0>H``6`"($HI2`"B>@!@`/\N2&P`OB\*3KH&)%!/U<!@`/\<2&P`JB\*S
  1397. XM3KH&$E!/U<!@`/\*2&P`KB\*3KH&`%!/U<!@`/[X2&W_[B\*3KH%[E!/U<!*$
  1398. XMK?_N9@QP?]"`P:P`NF``_M@I;?_N`*9@`/[.2&P`LB\*3KH%Q%!/U<!@`/Z\[
  1399. XM2&P`MB\*3KH%LE!/U<!@`/ZJ".P``@"]8`#^H!`:2(!R&%U!:P``BK![$`AF'
  1400. XM]$[[$`0`;F```"H`;6```!P`;&````X`9&````)"+`#-8!8([````+U@#@CL6
  1401. XM``,`O6`&".P`!0"]".P`!`"]8`#^3!E\``$`R6``_D)"+`#+8`#^.D(L`,Q@E
  1402. XM`/XR&7P``0#.8`#^*$(L`-!@`/X@&7P``0#*8`#^%E*&8`#]^'``8!9.NOFTR
  1403. XM+RW_]$AL`1A.NOG&0I=.NOC@3.T,X/_:3EU.=4CG(Q!P0+"L`+)F""`L`+HI%
  1404. XM0`"R1^P!*GX%SJP`L@@L``4`M6<"5(=P`!`S>``I0`(4(BP`KG0`1@*R@F<6$
  1405. XMLH!O%DAL`4Q(;`$T3KKY:%!/</]@8"E``*X@+`"ND*P`JBE``A0@+`"^<FS2(
  1406. XM@4ZZ!AQ*+`#,9P9R8]*!8`8B/````0B0@2(L`+9.N@8@+`!*K`"F9QH@+`"F-
  1407. XML(9O%DAL`6Y(;`%.3KKY#E!/</]@!BE&`*9P`$S?",1.=4Y5_[A(YP$01^W_P
  1408. XMP$HL`,QG#'`;%L`6_`!J%OP`-G`;%L`6_`!`%L`6_`!#0ALB+`"^%L$6P!;\@
  1409. XM`"$B+`"R%L%*+`#)9PH6P!;\`'`6_``Q%L`@2U*+2BP`S6<$<CE@`G(X$($6M
  1410. XMP!;\`#,B+`"V%L%*K`"J9PP6P!;\`&PB+`"J%L$6P!;\`%$B+`"N%L%*+`#*B
  1411. XM9PH6P!;\`%,6_``P(`M![?_`D(@N`"\'+P@O+`(03KH&3D_O``RPAV<.2'C_W
  1412. XM_TAL`<A.N@3N4$]P`$S?"(!.74YU$"P`SW(,L`%G)DAX``%(;`%P+RP"$$ZZ(
  1413. XM!A1/[P`,4X!G#DAX__](;`'(3KH$M%!/2BP`S&<N("P`OAE``*!(>``'2&P`;
  1414. XMFB\L`A!.N@7@3^\`#%^`9PY(>/__2&P!R$ZZ!(!03W``3G5.5?OV2.<'`$'MC
  1415. XM_@`I2`(<0>W\`"E(`B`L+`"J80``UBX`80`!SBH`<`FZ`&8:(`8B+`"JD($B/
  1416. XM+`#"3KH$>"`L`,*0@=R`8`)2AG`*N@!F$"PL`*HO!V$``%Y83RX`8$1P#+H`W
  1417. XM9A`L+`"J+P=A``"&6$\N`&`NO*P`KF\:+"P`JB\'80``,EA/+@!*+`#+9YAA8
  1418. XM``!*8`X@!4B`2,`O`&$``<183PP%`/]F`/]X<`!,WP#@3EU.=2\'+B\`"%*'S
  1419. XMOJP`IFT(80``+BX`8`I(>``*80`!DEA/(`<N'TYU+P=A``$2+@!*!VL&<`J^:
  1420. XM`&;P<``N'TYU3E7_[DCG#P!*K`%R9Q00+`#/<@RP`6<*2&P!=F$``3183U*L9
  1421. XM`7)*K`"B9P``QGX`2&P!>F$``1Q83UJ'*BP!<BP\```#Z$(M_^]*AF=`(`4BB
  1422. XM!DZZ`VPH`$J$9P9P`1M`_^]*+?_O9QH@!'(PT($O`&$``/Y83U*'(`0B!DZZY
  1423. XM`R*:@"`&<@I.N@,X+`!@O'`*OH!L#DAX`"!A``#66$]2AV#L+RP`HF$``*HNW
  1424. XMK`"B3KKV6-Z`+JP"!$ZZ]DY83R(L`A22@)*L`*HL`2`'4H>PAFP,2'@`(&$`/
  1425. XM`)A83V#L+RP"!&$``&Y(;`&`80``9G`"8`)P`$SM`/#_WDY=3G5*K`&$9CI(2
  1426. XM>`(`+RP"'"\L`@Q.N@.B3^\`#"E``81R`;"!;!9*@&H.2'C__TAL`<A.N@)4"
  1427. XM4$]P_V`8<``I0`&(4ZP!A"!L`AS1[`&(4JP!B!`03G4O"R9O``A*$V<0$!M(D
  1428. XM@$C`+P!A```*6$]@["9?3G4O!QXO``L,!P#_9R(@;`(@T>P!C%*L`8P@!Q"``
  1429. XM&4``SPRL```"``&,;`1P`&!>3KH!7DJ`9A9(>#``0J=.N@-N4$\"@```,`!*G
  1430. XM@&<280#\YDAX``%(;`'(3KH!NE!/+RP!C"\L`B`O+`(03KH"]$_O``RPK`&,?
  1431. XM9PY(>/__2&P!R$ZZ`9)03W``*4`!C"X?3G5.5?_N2.</,"9O`#(D;P`V>@`K3
  1432. XM2__N?`!*AF9*$!-R)+`!9@1\$&`Z<D"P`68$?`A@,'(EL`%F!'P"8"9R+;`!5
  1433. XM9@1Z`6`<<BNP`6<6<CVP`6<0<@FP`6<*<B"P`6<$4XM\"E*+8+)^`!@3<#FXK
  1434. XM`&\,`@0`7W!!N`!M*%\$!`0`,&T@(`1(@$C`L(9L%B`'(@9.N@$.(@1(@4C!0
  1435. XMT($N`%*+8,9*A6<((`=$@"2`8`(DAR`+D*W_[DS?#/!.74YU```@;P`$*4@!+
  1436. XMJB\.("P!P&8J("P!Q&84+'@`!$/Z`()P`$ZN_=@I0`'$9Q`L0$'L`9!.KO\TU
  1437. XM*4`!P&=0+%].=2\.+'@`!"`L`<!G(B)`(&D`5DZN_HQ*@&<4(D`O*0`43J[^^
  1438. XMAB`?#(````(`9BPL7TYU+PX@+`'$9R(L0"`L`<!G"B!`3J[_N$*L`<`B3BQX*
  1439. XM``1.KOYB0JP!Q'``+%].=6EN='5I=&EO;BYL:6)R87)Y`"!O``1(Z/[^``0A[
  1440. XM;P````!P`$YU("\`"&8"4H`@;P`$3.C^_@`$+V@`````3G4``$CG,``D`"8!^
  1441. XM2$)(0\3!QL#`P=1#2$)"0M""3-\`#$YU2H!J```>1(!*@6H```Q$@6$``"!$S
  1442. XM@4YU80``&$2`1(%.=4J!:@``#$2!80``!D2`3G4O`DA!-`%F```B2$!(04A"/
  1443. XM-`!G```&A,$P`DA`-`"$P3`"2$(R`B0?3G4O`W80#$$`@&0```;AF5%##$$(A
  1444. XM`&0```;IF5E##$$@`&0```;EF55#2D%K```&XYE30S0`YJA(0D)"YJI(0X#!O
  1445. XM-@`P`C0#2$'$P9""9```"%-#T(%D_G(`,@-(0^>X2$#!028?)!].=4CG(`(L7
  1446. XM>0```B1,[P`&``Q.KO_B3-]`!$YU```O#BQY```")"(O``A.KO_<+%].=4CGP
  1447. XM,`(L>0```B1,[P`.`!!.KO_63-]`#$YU``!(YS`"+'D```(D3.\`#@`03J[_A
  1448. XMT$S?0`Q.=0``+PXL>0```B1.KO_*+%].=2\.+'D```(D3J[_Q"Q?3G4O#BQY<
  1449. XM```")$ZN_WPL7TYU+PXL>0```$!,[P`#``A.KO[.+%].=0`````#[`````H`B
  1450. XM```!```0%```$`0```_T```/Y```#\H```^N```/F```#WX````4````#@``;
  1451. XM``````/R```#Z@```'(`````````````````````````````````````````4
  1452. XM`````````````````````````````````````````````````````````````
  1453. XM`````%!R:6YT1G@@,BXW("`P.2U-05DM.#D@8GD@1"Y7+E)E:7-I9RP@3DP@8
  1454. XM,3$U,4%6,3`*``````!0(%!R:6YT1G@@,BXW(`````"(&THV&T,`````````=
  1455. XM``````````4```#_````0````!T````!````"P````@```````$!`0`,`0!$)
  1456. XM;VYO="!K;F]W('=H870@=&\@9&\@=VET:#H@``!#86YN;W0@;W!E;CH@`%!!_
  1457. XM4CH``$YO('!R:6YT97(@*%!!4CHI````56YK;F]W;B!O<'1I;VXZ("T`4&`H#
  1458. XM,(F@1%```%)I9VAT(&UA<F=I;B!T;V\@;&%R9V4`````66]U(&%S:R!T;V\@4
  1459. XM;75C:"!L:6YE<R!P97(@<&%G90````P```````T,``!P86=E(``*"@``````"
  1460. XM`````````````4````%```K__P```@`````.````````````````````````:
  1461. XM```````````````!``````````````/L`````@````$```"6````A```````-
  1462. X/``/R```#Z0````````/R6
  1463. X``
  1464. Xend
  1465. Xsize 4740
  1466. SHAR_EOF
  1467. echo "extracting stoi.c"
  1468. sed 's/^X//' << \SHAR_EOF > stoi.c
  1469. X/* 01-12-86 by D.Reisig 1151AV 10 */
  1470. X
  1471. Xstoi(cp,retval) /* convert bin, oct, dec or hex string */
  1472. Xregister char *cp;
  1473. Xint *retval;
  1474. X{
  1475. Xregister int value, base, neg=0;
  1476. Xregister char digit;
  1477. Xchar *hold;
  1478. X  hold=cp;
  1479. X  for (base=0;!base;++cp){
  1480. X    if (*cp=='$') base=16;
  1481. X    else if (*cp=='@') base=8;
  1482. X    else if (*cp=='%') base=2;
  1483. X    else if (*cp=='-') neg=1;
  1484. X    else if ((*cp!='+')&&(*cp!='=')&&(*cp!='\t')&&(*cp!=' ')){
  1485. X      --cp;
  1486. X      base=10;
  1487. X    }
  1488. X  }
  1489. X  for (value=0;;++cp){
  1490. X    digit=*cp;
  1491. X    if (digit>'9'){
  1492. X      digit&=0x5f;
  1493. X      if (digit<'A') break; 
  1494. X      digit-=('A'-':');
  1495. X    }
  1496. X    digit-='0';
  1497. X    if ((digit<0)||(digit>=base)) break;
  1498. X    value=value*base+digit;
  1499. X  }
  1500. X  if (neg) *retval=-value;
  1501. X  else *retval=value;
  1502. X  return(cp-hold);   /* return length of string involved  */
  1503. X}
  1504. X
  1505. SHAR_EOF
  1506. echo "End of archive 1 (of 1)"
  1507. # if you want to concatenate archives, remove anything after this line
  1508. exit
  1509.